import { RequestHandler } from "express";

export function use(middleware: RequestHandler) {
  return function (target: any, key: string) {
    const original = Reflect.getMetadata("middlewares", target, key) || [];
    original.push(middleware);
    Reflect.defineMetadata("middlewares", original, target, key);
  };
}
